package cn.ycc1.boot3tx.controller;

import cn.ycc1.boot3tx.domain.dto.BuyBookDTO;
import cn.ycc1.boot3tx.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单管理
 * @author ycc
 * @date 2024/12/17
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/order")
public class OrderController {
    private final OrderService orderService;

    @PostMapping("/buy")
    public String buy(@RequestBody BuyBookDTO buyBookDTO) {
        orderService.buy(buyBookDTO);
        return "buy";
    }
}
